home *** CD-ROM | disk | FTP | other *** search
/ Interactive Media Design Review 1999 / Interactive Media Design Review 1999.iso / pc / allfiles / angry / intro.dir / 00003_cursorLoop.ls < prev    next >
Encoding:
Text File  |  1999-03-01  |  2.9 KB  |  108 lines

  1. global oldMouseP, drops, cursorSpr, animate, gravite
  2.  
  3. on enterFrame
  4.   if not soundBusy(1) then
  5.     puppetSound(1, member("fuckhead"))
  6.   end if
  7.   if the mouseV > 400 then
  8.     if the member of sprite 7 <> member("navbarupLonger") then
  9.       set the member of sprite 7 to member("navbarupLonger")
  10.       set the loc of sprite 7 to point(320, 491)
  11.     end if
  12.     if the mouseH < 80 then
  13.       set the member of sprite 5 to member("QuitON")
  14.     else
  15.       if the mouseH > 550 then
  16.         set the member of sprite 6 to member("creditsON")
  17.       else
  18.         set the member of sprite 5 to "QuitOFF"
  19.         set the member of sprite 6 to "creditsOFF"
  20.       end if
  21.     end if
  22.   else
  23.     if (the member of sprite 7 <> member("navBarDOWNLonger")) and (the member of sprite 7 <> member("infobarON")) then
  24.       set the member of sprite 7 to member("navBarDOWNLonger")
  25.       set the loc of sprite 7 to point(320, 491)
  26.       set the member of sprite 5 to "QuitOFF"
  27.       set the member of sprite 6 to "creditsOFF"
  28.     end if
  29.   end if
  30.   mouseP = point(the mouseH, the mouseV)
  31.   if inside(mouseP, rect(0, 0, 640, 480)) then
  32.     cursor(200)
  33.   else
  34.     cursor(-1)
  35.   end if
  36.   diffP = mouseP - oldMouseP
  37.   horiz = getAt(diffP, 1)
  38.   vert = getAt(diffP, 2)
  39.   drop = 1
  40.   if horiz < -5 then
  41.     if vert < -5 then
  42.       set the member of sprite cursorSpr to member("northwest")
  43.     else
  44.       if vert > 5 then
  45.         set the member of sprite cursorSpr to member("southwest")
  46.       else
  47.         set the member of sprite cursorSpr to member("west")
  48.       end if
  49.     end if
  50.   else
  51.     if horiz > 5 then
  52.       if vert < -5 then
  53.         set the member of sprite cursorSpr to member("northeast")
  54.       else
  55.         if vert > 5 then
  56.           set the member of sprite cursorSpr to member("southeast")
  57.         else
  58.           set the member of sprite cursorSpr to member("east")
  59.         end if
  60.       end if
  61.     else
  62.       if vert < -5 then
  63.         set the member of sprite cursorSpr to member("north")
  64.       else
  65.         if vert > 5 then
  66.           set the member of sprite cursorSpr to member("south")
  67.         else
  68.           set the member of sprite cursorSpr to member("stop")
  69.           drop = 0
  70.         end if
  71.       end if
  72.     end if
  73.   end if
  74.   set the loc of sprite cursorSpr to mouseP
  75.   repeat with a = 1 to count(drops)
  76.     doMe = getAt(drops, a)
  77.     check(doMe)
  78.   end repeat
  79.   if (random(2) = 2) and drop then
  80.     repeat with a = 1 to count(drops)
  81.       doMe = getAt(drops, a)
  82.       if not doMe.pActive then
  83.         drop(doMe, cursorSpr)
  84.         exit repeat
  85.       end if
  86.     end repeat
  87.   end if
  88.   oldMouseP = point(the mouseH, the mouseV)
  89.   animLoop = 1
  90.   repeat with i = 1 to count(animate)
  91.     doMe = getAt(animate, i)
  92.     animLoop(doMe)
  93.   end repeat
  94.   animLoop = 0
  95.   gravitate = 1
  96.   if count(gravite) > 0 then
  97.     repeat with x = 1 to count(gravite)
  98.       doMe = getAt(gravite, x)
  99.       gravitate(doMe)
  100.     end repeat
  101.   end if
  102.   gravitate = 0
  103. end
  104.  
  105. on exitFrame
  106.   go(the frame)
  107. end
  108.